Conversation
…ng it (#36361) In the new block editor, selecting an image and clicking the toolbar Link button deleted the image and replaced it with a text link. The image node already supports href/target attributes end-to-end; the break was purely in the UI flow, which always routed through the text-link insert path. - Toolbar Link button now detects a selected dotImage and opens the link popover in image-link mode (URL + open-in-new-tab only; no Text/Advanced), applying the link via updateAttributes('dotImage') so the image is preserved. - Add a Remove-link (trash) action when editing an image that already has a link. - Clicking a linked image no longer opens the text-link editor; it selects the image node (link is edited from the toolbar) and prevents navigation. - Fix layout jump/extra margin when a link wraps the image: zero the inline-block baseline gap and the Tailwind Typography img margin that returns once the image is no longer a direct figure child. - Toolbar Link button reflects an active state for linked images (isImageLinked), mirroring isLink for text links. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @rjvelazco's task in 1m 34s —— View job Rollback Safety Analysis
Result: ✅ Safe to Roll BackAll 13 changed files are frontend (Angular/TypeScript) and one
Summary: The PR is purely UI — Angular component logic and templates for the block editor link popover, image/video TipTap node extensions, CSS layout fixes, and one i18n key addition. ProseMirror node attribute additions ( Label added: |
🤖 dotBot Review (Bedrock)Reviewed 13 file(s); 12 candidate(s) → 7 confirmed, 2 uncertain (unverified, kept for review).
Confirmed findings
🔎 Uncertain (could not confirm or disprove — review manually)
us.deepseek.r1-v1:0 · Run: #28463711457 · tokens: in: 96490 · out: 27973 · total: 124463 · calls: 36 · est. ~$0.281 |
…top layout jump (#36361) Once the <a> wraps the image, the anchor (not the img) is the inline-level box in the figure's formatting context, so it sits on the baseline and the browser reserves font-descender space below it (~12px). Align the anchor to the top too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The wrapping <a> made the browser treat clicks as link interactions, so ProseMirror needed several clicks before it node-selected the image and showed its toolbar options. Select the node on the first mousedown from the image node view and suppress the anchor's default behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o-an-image-image-properties-menu-not-accessible
|
@claude review this changes, pretty please |
|
Claude finished @rjvelazco's task in 1m 21s —— View job Code Review
Overall AssessmentThis is a clean, well-scoped fix. The core approach is correct: routing the link toolbar button through Below are the issues I found, from most to least significant. 🔴 Bug:
|
| Severity | Issue | File | Line |
|---|---|---|---|
| 🔴 Bug (latent) | { href } spreads null into anchorAttrs |
image.extension.ts |
143 |
| 🟡 Missing tests | onRemoveImageLink has no spec |
link-popover.component.ts |
433 |
| 🟡 A11y | Remove button only responds to mousedown, not keyboard click |
link-popover.component.html |
187 |
The href: null spread is latent (current guard prevents it rendering), but it should be fixed before it causes confusion. Fix this →
- image.extension.ts: build anchorAttrs conditionally so a null href never serializes as href="null" (latent issue flagged in review). - link-popover.component.html: make the Remove-link button keyboard-accessible by splitting into (mousedown) preventDefault + (click) handler, so Enter/Space activate it without blurring the editor or double-firing on mouse. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#36361) Gate the link-navigation preventDefault on the *clicked* element being an image (within the anchor) rather than any descendant img, so a text click in a mixed anchor still routes to the text-link editor. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review dispositionsThanks for the automated reviews. Summary of how each finding was handled: Addressed
False positives (no change)
Acknowledged, no change
Note on testsNo spec was added for |
The trash (Remove link) button now shows whenever editing an existing link, not just images. Generalized onRemoveImageLink → onRemoveLink: images clear href/target; text links unset the link mark over its full range. Gated on canRemoveLink (existing href for images, linkEl for text) so it never shows while creating a new link over selected text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n attrs (#36361) The new editor's dotVideo node only declared src/title/data, so the legacy block-editor's mimeType/width/height/orientation attributes were silently dropped when an old document was re-saved (TipTap discards undeclared attrs), and server-side rendering that reads width/height would lose them. Re-declare the four attributes (parse + conditional render) for round-trip parity with the legacy node; title stays as an additive extra. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o-an-image-image-properties-menu-not-accessible
…on from contentlet (#36361) Mirrors the legacy getVideoAttrs but resolves file metadata via the canonical getFileMetadata helper (handles both metaData and assetMetaData shapes) instead of reading assetMetaData only. New shared videoMetaAttrsFromContentlet() is used on both contentlet-bearing insert paths: the dotCMS picker (insertDotVideoFromContentlet) and the drag-drop upload (uploadVideo → UploadedVideo). URL-paste has no contentlet, so those attrs stay null. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Proposed Changes
Fixes #36361 — in the new block editor, selecting an image and clicking the toolbar Link button deleted the image and replaced it with a text link. The
dotImagenode already supportshref/targetend-to-end (it parses a wrapping<a>and re-wraps the<img>on render); the break was purely in the UI flow, which always routed through the text-link insert path.What changed
dotImagenode is selected, the link popover opens in image-link mode (URL + "Open in new tab" only; Text/Advanced fields hidden) and applies the link viaupdateAttributes('dotImage', { href, target }), so the image is preserved instead of replaced.href/target.imgmargin that reappears once the image is no longer a direct<figure>child.isImageLinked), mirroringisLinkfor text links.The text-link flow is unchanged. No
dotImagenode name or stored-content shape changed — links round-trip through the existinghref/targetattributes, so no data migration is required.Files
link-popover.component.{ts,html}— image-link mode, Remove actiontoolbar.component.{ts,html}+editor-toolbar.store.ts— image detection, active stateeditor-chrome-click.ts— don't open the dialog on linked-image clickseditor.component.css— layout/margin fixeseditor-popover.service.ts—isImageLinkpayload flagLanguage.properties—dot.block.editor.dialog.link.removeTesting
pnpm nx lint new-block-editor✓tsc --noEmiton the lib ✓<a>(not replaced); re-select shows active Link button + trash to remove; no layout jump toggling the link; text-link flow unchanged.Video
video.mov
🤖 Generated with Claude Code
This PR fixes: #36361